package com.shareyi.baseproject.kernel.common.event;

import com.google.common.eventbus.AllowConcurrentEvents;
import com.google.common.eventbus.Subscribe;

/**
 * 事件订阅,<strong>实现类必须是线程安全的</strong>
 *
 * @author qiulong
 * @date 2018.12.12
 */
public interface EventSubscriber {

    /**
     * 处理事件.
     * <p>
     * Notice: Subscriber抛出的异常, 事件发送端无法感知, 需要Subscriber自行处理异常
     *
     * @param event
     */
    @Subscribe
    @AllowConcurrentEvents
    void handle(Event event);

}
